﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Content/Master.Master" Inherits="System.Web.Mvc.ViewPage<SCS.Core.Models.Collection.TypeProductCollection>" %>
<%@ Import Namespace="SCS.Core" %>
<%@ Import Namespace="SCS.Core.Models" %>
<%@ Import Namespace="SCS.Core.ViewModels" %>
<%@ Import Namespace="SCS.Core.Controllers" %>
<%@ Import Namespace="SCSService" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Danh mục sản phẩm
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript" src="/Scripts/ui.dropdownchecklist-1.4-min.js"></script>
    <script src="/Scripts/jquery.selectboxes.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftMvcJQueryValidation.js" type="text/javascript"></script>
    <script type="text/javascript" src="/ThemeExtends/AdminSkin/js/jquery.flot.js"></script>
    <script type="text/javascript" src="/ThemeExtends/AdminSkin/js/jquery.flot.stack.js"></script>	 
    <link href="/Content/smoothness-1.8.13/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css" />
    <link href="/Content/smoothness-1.8.13/ui.dropdownchecklist.themeroller.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/Scripts/jquery-1.6.1.min.js"></script>
    <script type="text/javascript" src="/Scripts/jquery-ui-1.8.13.custom.min.js"></script>
    <script type="text/javascript" src="/Scripts/ui.dropdownchecklist-1.4-min.js"></script>
    <script type="text/javascript" src="/Scripts/ui.dropdownchecklist.js"></script>
    <%--Validator--%>
    <script src="/Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftMvcJQueryValidation.js" type="text/javascript"></script>

    

    <% Html.EnableClientValidation(); %>
   
         <% using (Html.BeginForm((bool)ViewData["IsAdd"] ? "SaveAdd" : "SaveEdit", "Stock", FormMethod.Post, new { siteGuid = "sendFileForm", language = "sendFileForm", id = "sendFileForm", enctype = "multipart/form-data" }))
            {%>
     
     <div class="clear"></div>
       
        <div class="box ">
		    <h2 class="box-header"><%=(bool)ViewData["IsAdd"] ? "Thêm danh mục sản phẩm" : "Sửa danh mục sản phẩm" %></h2>
		    <div class="box-content">

                <label class="form-label"> Tên </label>
                <%= Html.TextBoxFor(m => m.TypeProductName, new { @class = "form-field width30" })%> <span style="color:Red;font-weight:bold"><%= Html.ValidationMessageFor(m => m.TypeProductName) %></span>
               
                <%--<label class="form-label"> Biến param (Để trống) </label>
                 <%= Html.TextBoxFor(m => m.TypeProductParam, new { @class = "form-field width30", @readonly=readonly})%>--%>
                 <br /><br />
                 <label class="form-label"> Mô tả </label>
                 <%= Html.TextAreaFor(m => m.TypeProductDes, new { @class = "form-field half" })%>
                   <br />
                 <label class="form-label"> Ảnh </label>

                 <%if (Model.TypeProductImage != null)
                   {
                       string src = Model.TypeProductImage;
                       
                           %>
                            <img src="http://paynetvn.com/<%=Model.TypeProductImage %>" width="130px" alt="" id="imgname" onclick="window.open('/Editor/aspnet/Images.aspx','images',' width=750,height=450,left=150,top=200,toolbar=no,status=0,scrollbars=1,location=0,');" />  
                           <%
                   }
                   else
                   { 
                   %>
                     <img src="/Content/images/noimage.gif" width="130px" id="imgname" alt="" onclick="window.open('/Editor/aspnet/Images.aspx','images',' width=750,height=450,left=150,top=200,toolbar=no,status=0,scrollbars=1,location=0,');" />
                   <%
                   }
                  %>
                 <input type="hidden" id="url" name="url"/>
                  
                 <%if ((bool)ViewData["IsAdd"] == false) { 
                   %><br /><br />
                    <label class="form-label"> Ngôn ngữ </label>
                    <%= Html.DropDownList("LanguagesID", (SelectList)ViewData["ListLanguage"], "--Chọn--", new { @class = "width20" })%>
                    
                   <%
                   }
                   %>    
                        
                 
                    <br /><br />
                 <label class="form-label">Danh mục cha</label>
                 <%= Html.DropDownList("ParentTypeProductID", (SelectList)ViewData["ListParent"], "--Select--", new { @class = "width20" })%>
                 <br /><br />
                 <label class="form-label"> Trạng thái </label>
                 <%if (Model.TypeProductStatus == 1)
                   {
                   %>
                        <%=Html.CheckBox("TypeProductStatus", true)%>
                   <%
                     }
                   else
                   {
                       if ((bool)ViewData["IsAdd"])
                       {
                       %>
                        <%=Html.CheckBox("TypeProductStatus", true)%>
                       <%
                       }
                       else
                       { 
                       %>
                        <%=Html.CheckBox("TypeProductStatus", false)%>
                       <%
                       }
                    
                   } 
                    %>
                    <br /><br />
                <label class="form-label">Metadata Title </label>
                <%= Html.TextBoxFor(m => m.Title, new { @class = "form-field small" })%>
                <br /><br />
                <label class="form-label">Metadata Keyword </label>
                <%= Html.TextBoxFor(m => m.MetaKeyword, new { @class = "form-field width30" })%>
                <br /><br />
                <label class="form-label">Metadata Description </label>
                 <%= Html.TextAreaFor(m => m.MetaDescription, new { @class = "form-field small" })%>

                 <%=Html.TextBoxFor(m => m.TypeProductID, new {@Style="display:none" })%>

                
                 <p>
                <%=ViewData["Result"]%>
                </p>
                    
                 <div class="list-text-box">
                </div>
                    
                
                 <%
                    if ((bool)ViewData["IsAdd"])
                    {

                    }
                    else
                    { 
                    %> 
                         
                    <%
                    }  
                 %>
                    
                 <input type="submit" value="" class="button white_input save_input "/> <!--Button Save-->
                 <a class="button white" href="javascript:history.back();"><span class="icon_text cancel"></span>Đóng</a> <!--Button Close-->
	        </div>
	    </div>
        <div class="clear"></div>
    <% } %>
    

</asp:Content>
